<% layout('/layouts/default.html', {title: '申请结算', libs: ['validate']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text('申请结算')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${settlementApplyCount}" action="${ctx}/natatoriumgoods/natatoriumGoods/save" method="post">		
				<table border="1" align="center">
					<tr>
						<th>结算类型</th>
						<th>订单数</th>
						<th>结算金额</th>
					</tr>
					<tr>
						<td>首款${settlementApplyCount.settlementFirst}%</td>
						<td>${settlementApplyCount.firstOrderNum}</td>
						<td>${settlementApplyCount.firstMoney}</td>
					</tr>
					<tr>
						<td>尾款${settlementApplyCount.settlementLast}%</td>
						<td>${settlementApplyCount.lastOrderNum}</td>
						<td>${settlementApplyCount.lastMoney}</td>
					</tr>
					<tr>
						<td>游泳票</td>
						<td>${settlementApplyCount.swimmingTicketOrderNum}</td>
						<td>${settlementApplyCount.swimmingTicketMoney}</td>
					</tr>
				</table>
				<span style="color:red;cursor: pointer;text-align: center;display:block;" align="center">总计：${settlementApplyCount.allMoney}</span>
		</#form:form>
	</div>
	<div class="box-footer">
		<div class="row">
			<div class="col-sm-offset-2 col-sm-10">
				<button type="button" class="btn btn-sm btn-primary" id="verification"><i class="fa fa-check"></i> ${text('提交申请')}</button>&nbsp;
				<button type="button" class="btn-cancel" id="btnCancel" onclick="js.closeCurrentTabPage()">${text('返回')}</button>
			</div>
		</div>
	</div>	
</div>
<% } %>
<style type="text/css">
table td{ height:30px;width:100px;}
table th{ height:30px;width:100px;}
</style>
<script>
$(document).ready(function() {
	$("#verification").click(function() {
 		$.ajax({
	  		url: "${ctx}/settlementapply/settlementApply/settlementApply",
	        type: "post",
	        contentType: "application/json",
	        data: "",
	        success: function (data) {
	        	js.showMessage("申请结算成功！请等待审核，审核通过后资金即可到账。");
	        	js.closeCurrentTabPage();
     		}
  		})
	})
})
</script>